﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ExportInternalElementViewModel.cs" >
//   J. Prinz
// </copyright>
// <summary>
//   the ImportStatus reflects the state of an exported InternalElement of a source system when
//   it is integrated in the importing environment of a target system
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace AutomationMLMapper.ViewModels.CAEXObjectViewModels
{
    using CAEX_ClassModel;

    using AutomationMLMapper.ViewModels.SystemViewModels;

    /// <summary>
    ///   the ImportStatus reflects the state of an exported InternalElement of a source system when 
    ///   it is integrated in the importing environment of a target system
    /// </summary>
    public enum ImportStateEnum
    {
        /// <summary>
        ///   imported state indicates, that the internal element has been imported successful
        /// </summary>
        Imported, 

        /// <summary>
        ///   unused state indicates, that the internal element has not been imported (initial state)
        /// </summary>
        Unused, 

        /// <summary>
        ///   ambiguos state indicates, that the internal element could not be imported because of conflicts
        /// </summary>
        Ambiguos
    }

    /// <summary>
    ///   UI Representation of an Internal Element <see cref="InternalElementType" /> when it is used as input
    ///   to an importing System <see cref="TargetSystemViewModel" />
    /// </summary>
    public class ExportInternalElementViewModel : InternalElementViewModel
    {
        #region Fields

        /// <summary>
        ///   <see cref="ImportState"/>
        /// </summary>
        private ImportStateEnum importState;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        ///  Initializes a new instance of the <see cref="ExportInternalElementViewModel"/> class. 
        /// </summary>
        /// <param name="element">
        ///  a CAEX - InternalElement 
        /// </param>
        public ExportInternalElementViewModel(InternalElementType element)
            : base(element)
        {
        }

        #endregion

        #region Public Properties

        /// <summary>
        ///   DisplayName of the CAEX-Element in the UI used in Headers and Labels
        /// </summary>
        public static new string DisplayName
        {
            get
            {
                return "Exported InternalElement";
            }
        }

        /// <summary>
        ///   ImportState of the InternalElement
        /// </summary>
        public ImportStateEnum ImportState
        {
            get
            {
                return this.importState;
            }

            set
            {
                this.importState = value;
                this.OnNotifyPropertyChanged("IsImported");
            }
        }

        #endregion
    }
}